package cn.bone.springDemo.test01.advice;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created by superbone on 2018/9/4.
 */
@Component
@Aspect
public class LogAdvice {

    @Pointcut("@annotation(cn.bone.springDemo.test01.annotation.LogCut)")
    public void targetMethod(){

    }

    @Before("targetMethod()")
    public void before(){
        System.out.println("before...");
    }

    @After("targetMethod()")
    public void after(){
        System.out.println("after");
    }
}
